#include <windows.h>
#include "w32cmn.h"

// ----------------------------------------------------------------------------
void InvalidateHandle(HANDLE& hHandle )
{
	hHandle = NULL;
}


void CloseAndCleanHandle(HANDLE& hHandle)
{
	if(hHandle == NULL)
		return;

	BOOL abRet  = CloseHandle( hHandle ) ;
	if ( !abRet )
	{
	}
	InvalidateHandle ( hHandle );

}
void InvalidateHandleX(HANDLE& hHandle )
{
	hHandle = INVALID_HANDLE_VALUE;
}


void CloseAndCleanHandleX(HANDLE& hHandle)
{
	if(hHandle == INVALID_HANDLE_VALUE)
		return;

	BOOL abRet  = CloseHandle( hHandle ) ;
	if ( !abRet )
	{
	}
	InvalidateHandleX ( hHandle );

}

// ----------------------------------------------------------------------------
